<?php
	if ($act == 'add') {
		if (isset($_POST['page_id'])) $page_id = $_POST['page_id'];	else $page_id = 0;
		if (isset($_POST['parent_id'])) $parent_id = $_POST['parent_id']; else $parent_id = 0;
		if (isset($_POST['parent_type'])) $parent_type = $_POST['parent_type']; else $parent_type = "";
		if (isset($_POST['parent_name'])) $parent_name = $_POST['parent_name']; else $parent_name = "";
		if (isset($_POST['data'])) $data_comment = $_POST['data']; else $data_comment = array();
		$res = $commentclass->add_comment($page_id, $parent_id, $parent_type, $parent_name, $data_comment);
		if ($res != 0) $err->AddError($res, "comment");
		header ("location: ".$_SERVER['HTTP_REFERER']);
		exit();
	}
?>